import time
import pyautogui
import keyboard

time.sleep(5)

z = pyautogui.position()

while 1:
    pyautogui.click(z[0],z[1])
    if keyboard.is_pressed('esc'):
        break